<?php

namespace app\shop\validate;

class UserCartValidate extends BaseValidate
{
    protected $rule = [
        'sku_id'   => 'require',
        'num'      => 'require|number',
        'id'       => 'require',
        'selected' => 'require',
    ];

    protected $message = [
        'sku_id.require'   => '规格ID不能为空',
        'num.require'      => '数量不能为空',
        'id.require'       => '购物车ID不能为空',
        'selected.require' => '选中状态不能为空',
    ];

    protected $scene = [
        'list'       => ['page_size'],
        'add'        => ['sku_id', 'num'],
        'edit'       => ['id'],
        'delete'     => ['id'],
        'select_all' => ['selected']
    ];
}
